﻿<Page
    x:Class="OpenRPOSMetro.SettingsDialog"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:local="using:OpenRPOSMetro"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    mc:Ignorable="d">
    <Page.Resources>
        <Style x:Key="ListViewItemStyleOpenRPOS" TargetType="ListViewItem">
            <Setter Property="FontFamily" Value="{ThemeResource ContentControlThemeFontFamily}"/>
            <Setter Property="FontSize" Value="{ThemeResource ControlContentThemeFontSize}"/>
            <Setter Property="Background" Value="Transparent"/>
            <Setter Property="TabNavigation" Value="Local"/>
            <Setter Property="IsHoldingEnabled" Value="True"/>
            <Setter Property="Margin" Value="0,0,18,2"/>
            <Setter Property="HorizontalContentAlignment" Value="Left"/>
            <Setter Property="VerticalContentAlignment" Value="Top"/>
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="ListViewItem">
                        <ListViewItemPresenter SelectedBorderThickness="0" CheckHintBrush="{ThemeResource ListViewItemCheckHintThemeBrush}" CheckBrush="{ThemeResource ListViewItemCheckThemeBrush}" ContentMargin="3" ContentTransitions="{TemplateBinding ContentTransitions}" CheckSelectingBrush="{ThemeResource ListViewItemCheckSelectingThemeBrush}" DragForeground="{ThemeResource ListViewItemDragForegroundThemeBrush}" DragOpacity="{ThemeResource ListViewItemDragThemeOpacity}" DragBackground="{ThemeResource ListViewItemDragBackgroundThemeBrush}" DisabledOpacity="{ThemeResource ListViewItemDisabledThemeOpacity}" FocusBorderBrush="{ThemeResource ListViewItemFocusBorderThemeBrush}" HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}" Padding="{TemplateBinding Padding}" PointerOverBackgroundMargin="1" PlaceholderBackground="{ThemeResource ListViewItemPlaceholderBackgroundThemeBrush}" PointerOverBackground="{ThemeResource ListViewItemPointerOverBackgroundThemeBrush}" ReorderHintOffset="{ThemeResource ListViewItemReorderHintThemeOffset}" SelectedPointerOverBorderBrush="{ThemeResource ListViewItemSelectedPointerOverBorderThemeBrush}" SelectionCheckMarkVisualEnabled="False" SelectedForeground="{ThemeResource ListViewItemSelectedForegroundThemeBrush}" SelectedPointerOverBackground="{ThemeResource ListViewItemSelectedPointerOverBackgroundThemeBrush}" SelectedBackground="{ThemeResource ListViewItemSelectedBackgroundThemeBrush}" VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}"/>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>
    </Page.Resources>
    <Grid
        x:Name="RootPanel"
        Background="#FF98DEF8"
        Opacity=".75"
        HorizontalAlignment="Stretch"
        VerticalAlignment="Stretch">

        <Grid x:Name="LayoutRoot" Background="{ThemeResource ApplicationPageBackgroundThemeBrush}" Width="650" Height="700" >
            <Grid.RowDefinitions>
                <RowDefinition Height="90"/>
                <RowDefinition Height="Auto" />
                <RowDefinition Height="100" />
            </Grid.RowDefinitions>
            <TextBlock HorizontalAlignment="Center" Margin="10" FontSize="30" TextWrapping="Wrap" Text="Local Settings" VerticalAlignment="Top"/>
            <ListView Grid.Column="1" Grid.Row="0" HorizontalAlignment="center" Margin="0,0,0,0" VerticalAlignment="Bottom" Width="600" x:Name="lvSettingsHeader" SelectionMode="Multiple" >
                <ListView.HeaderTemplate>
                    <DataTemplate>
                        <Grid Background="LightGray">
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="300" />
                                <ColumnDefinition Width="300" />
                            </Grid.ColumnDefinitions>
                            <TextBlock Grid.Column="0" Text="Setting" FontSize="28" Margin="5,0,0,0" />
                            <TextBlock Grid.Column="1" Text="Value" FontSize="28" />
                        </Grid>
                    </DataTemplate>
                </ListView.HeaderTemplate>
            </ListView>
            <ListView Grid.Column="1" HorizontalAlignment="Center" Grid.Row="1" Margin="0,0,0,20" VerticalAlignment="Top" Height="480" Width="600" x:Name="lvSettings" SelectionMode="Single" ItemContainerStyle="{StaticResource ListViewItemStyleOpenRPOS}" IsSwipeEnabled="False" SelectionChanged="lvSettings_SelectionChanged" >
                <ListView.ItemContainerTransitions>
                    <TransitionCollection/>
                </ListView.ItemContainerTransitions>
                <ListView.ItemTemplate>
                    <DataTemplate>
                        <Grid>
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="290" />
                                <ColumnDefinition Width="80" />
                            </Grid.ColumnDefinitions>
                            <TextBlock Grid.Column="0" Text="{Binding Setting}" FontSize="28" Margin="5,0,0,0" />
                            <TextBlock Grid.Column="1" Text="{Binding Value}" FontSize="28" HorizontalAlignment="Right" />
                        </Grid>
                    </DataTemplate>
                </ListView.ItemTemplate>
            </ListView>
            <Button x:Name="btnEdit" Content="Edit" Width="120" Height="85" FontSize="28" Margin="60,10" HorizontalAlignment="Left" Grid.Row="2" IsEnabled="False" Click="btnEdit_Click" />
            <Button x:Name="btnDone" Content="Done" Width="120" Height="85" Margin="60,10" FontSize="28" HorizontalAlignment="Right" Grid.Row="2" Click="btnDone_Click" />
        </Grid>
    </Grid>

</Page>
